﻿<%@ include file="../inc/common.jsp"%>
<!DOCTYPE HTML>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<title>缴费列表</title>
<style>
    .page{margin-top:5px;border-top: 1px solid #DDDDDD;padding: 2px;border-bottom: 1px solid #DDDDDD;font-family: inherit;font-size: 11px;}
    .page a{border:1px solid #DDDDDD;text-align: center;}
    .page a:HOVER{text-decoration: none;font-color: white;}
    .current{background:#23B300;color:white; display: inline-block;height:19px ;width:19px;}
    .num{display: inline-block;height:19px ;width:19px;}
</style>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 财务管理 <span class="c-gray en">&gt;</span> 缴费列表<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="pd-20">
    <div class="text-c"> <!-- 日期范围： -->
        <!-- <input type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}'})" id="datemin" class="input-text Wdate" style="width:120px;">
        -
        <input type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d'})" id="datemax" class="input-text Wdate" style="width:120px;"> -->
        <form action="/feeInfo/search.htm" method="POST">
            <input type="text" class="input-text" style="width:250px" placeholder="输入学生姓名" id="" name="name" value="${name}">
            <s:if test="isFee==false">
                <input type="hidden" id="isFee" name="isFee" value="false"/>
            </s:if>
            <s:else>
                <input type="hidden" id="isFee" name="isFee" value="true"/>
            </s:else>
            <button type="submit" class="btn btn-success" ><i class="Hui-iconfont">&#xe665;</i> 搜索学生</button>
        </form>
    </div>
    <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l">
	<%--<a href="javascript:;" onclick="batchDelete()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
	<a href="/student/add.htm"  class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i>点击新增学生</a></span>--%> <span class="r">共有数据：<strong>${page.allCount}</strong> 条</span> </div>
    <table class="table table-border table-bordered table-bg">
        <thead>
        <tr>
            <th scope="col" colspan="6">缴费列表</th>
        </tr>
        <tr class="text-c">
            <th width="25"><input type="checkbox"  /></th>
            <th width="90">姓名</th>
            <th width="90">学号</th>
            <th width="90">金额</th>
            <th width="90">缴费时间</th>
            <s:if test="isFee==false">
                <th width="90">操作</th>
            </s:if>
        </tr>
        </thead>
        <tbody>
        <s:if test="page.allCount!=0">
            <s:iterator value="page.records" >
                <tr class="text-c">
                    <td><input type="checkbox" value="${id}" name="ids"></td>
                    <td>${studentName}</td>
                    <td>${stuNo }</td>
                    <td>${amount }</td>
                    <td>${createTimeStr }</td>
                    <s:if test="isFee==false">
                    <td class="td-manage"><a style="text-decoration:none" onClick="member_stop(this,'10001','${stuNo}')" href="javascript:;" title="缴费"><i class="Hui-iconfont">&#xe631;</i></a> </td>
                    </s:if>
                </tr>
            </s:iterator>
        </s:if>
        <s:else>
            <tr class="text-c">
                <td style="text-align: center;" colspan="6">暂无数据!</td>
            </tr>
        </s:else>
        </tbody>
    </table>
    <div class="page">
        ${page.pageCententHTML}
    </div>
</div>
<script type="text/javascript">
    function admin_add(title,url,w,h){
        layer_show(title,url,w,h);
    }
    /*管理员-删除*/
    function admin_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){

            $(obj).parents("tr").remove();
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }
    /*管理员-编辑*/
    function admin_edit(title,url,id,w,h){
        layer_show(title,url,w,h);
    }
    /*管理员-停用*/
    function admin_stop(obj,id){
        layer.confirm('确认要停用吗？',function(index){
            //此处请求后台程序，下方是成功后的前台处理……

            $(obj).parents("tr").find(".td-manage").prepend('<a onClick="admin_start(this,id)" href="javascript:;" title="启用" style="text-decoration:none"><i class="Hui-iconfont">&#xe615;</i></a>');
            $(obj).parents("tr").find(".td-status").html('<span class="label label-default radius">已禁用</span>');
            $(obj).remove();
            layer.msg('已停用!',{icon: 5,time:1000});
        });
    }

    /*管理员-启用*/
    function admin_start(obj,id){
        layer.confirm('确认要启用吗？',function(index){
            //此处请求后台程序，下方是成功后的前台处理……


            $(obj).parents("tr").find(".td-manage").prepend('<a onClick="admin_stop(this,id)" href="javascript:;" title="停用" style="text-decoration:none"><i class="Hui-iconfont">&#xe631;</i></a>');
            $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已启用</span>');
            $(obj).remove();
            layer.msg('已启用!', {icon: 6,time:1000});
        });
    }

    /**
     * 单删除
     */
    function deleteOne(url,obj)
    {
        layer.confirm('确认要删除该条数据吗？', function(index)
        {
            $.ajax({
                type: 'POST',
                url: url ,
                success:function(data)
                {
                    if(data=="success")
                    {
                        $(obj).parents("tr").remove();
                        layer.msg('已删除!', {
                            icon : 1,
                            time : 1000
                        });
                        javascript:location.replace(location.href);
                    }
                }
            });
        });
    }
    /**
     * 批量删除
     */
    function batchDelete()
    {
        var id = [];
        $("table input[name='ids']").each(function()
        {
            if($(this).is(':checked'))
            {
                id.push($(this).val());
            }
        });
        if(id.length==0)
        {
            layer.alert('请至少选择一条数据');
            return;
        }
        var ids = "";
        for(var i = 0;i<id.length;i++)
        {
            ids = ids +id[i]+","
        }
        layer.confirm('确认要删除选中的吗？', function(index)
        {
            $.ajax({
                type: 'POST',
                url: "/student/batchDelete.htm",
                data:{"ids":ids},
                success:function(data)
                {
                    if(data=="success")
                    {
                        layer.msg('已删除!',
                                {
                                    icon : 1,
                                    time : 1000
                                });
                        javascript:location.replace(location.href);
                    }
                }
            });
        });
    }

    /*用户-停用*/
    function member_stop(obj,id,stuNo){
        layer.confirm('确认更改该学生的缴费状态吗？',function(index){

            $.ajax({
                type: 'POST',
                url: "/feeInfo/pay.htm",
                data:{"stuNo":stuNo},
                success:function(data)
                {
                    if(data=="success")
                    {
                        $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="member_start(this,id)" href="javascript:;" title="缴费"><i class="Hui-iconfont">&#xe6e1;</i></a>');
                        //$(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">已缴费</span>');
                        $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已缴费</span>');
                        $(obj).remove();
                        layer.msg('缴费成功!',{icon: 6,time:1000});
                    }
                }
            });



        });
    }
/*
    *//*用户-启用*//*
    function member_start(obj,id){
        layer.confirm('确认更改该学生的缴费状态吗？',function(index){
            $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="member_stop(this,id)" href="javascript:;" title="停用"><i class="Hui-iconfont">&#xe631;</i></a>');
            $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已启用</span>');
            $(obj).remove();
            layer.msg('已启用!',{icon: 6,time:1000});
        });
    }*/
</script>
</body>
</html>